﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;


namespace BackupSvc
{
    using System.ServiceProcess;

    [RunInstaller(true)]
    public partial class BackupSvcInstaller : Installer
    {
        private ServiceInstaller serviceInstaller1; //**3**
        private ServiceProcessInstaller serviceProcessInstaller1; //**4**

        public BackupSvcInstaller()
        {
            InitializeComponent();

            ServiceInstaller serviceInstaller1 = new ServiceInstaller();
            ServiceProcessInstaller serviceProcessInstaller1 = new ServiceProcessInstaller();

            serviceInstaller1.DisplayName = "BackupSvc";
            serviceInstaller1.ServiceName = "BackupSvc";

            serviceInstaller1.StartType = ServiceStartMode.Automatic; 

            serviceProcessInstaller1.Account = ServiceAccount.LocalSystem;
            serviceProcessInstaller1.Password = null;
            serviceProcessInstaller1.Username = null;

            Installers.AddRange(new Installer[] {serviceProcessInstaller1, serviceInstaller1});
        }
    }
}
